package com.ddzh.web;

import com.ddzh.entity.Result;
import com.ddzh.service.CheckGroupItemService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/checkGroupItem")
public class CheckGroupItemController {

    @Reference //这里夸项目访问=》夸IoC容器访问=》夸服务器后台访问数据
    private CheckGroupItemService checkGroupItemService;

    @GetMapping("/selectItemIds/{groupId}")//用的是动态传参：请求路径直接给一个数据即可不用key=value格式
    public Result selectItemIds(@PathVariable("groupId") Long groupId){
        System.out.println("groupId = " + groupId);
        Result result = new Result(checkGroupItemService.findByGroupId(groupId));
        System.out.println("result.getData().toString() = " + result.getData().toString());
        return  result;
    }

}
